<template>
	<view class="">
		<scroll-view scroll-y="true" class="scroll">
			<view>
				<view>
					<view>
						<view v-for="(i,index) in Imageforall" :key="Imageforall.id">
							<view class="border">
								<view>
									{{i.name}}
								</view>
								<view class="scoref" v-show="i.isscore1">{{i.score1}}</view>
								<view class="desco" v-show="i.isdesco">{{i.deductedscore}}</view>

								<view class="btn" v-for="(j,index) in i.Imageall" :key="i.Imageall.id">
									<image :src="j.Image"
										style="width: 100rpx; height: 100rpx; margin-left: 20rpx; margin-top: 20rpx;"
										@click="checkimg(i,index)"></image>
									<button @click="addpicture(i,index)" :disabled="j.ban"
										class="picbtn">{{j.fname}}</button>
									<button @click="deducted(i,index)" class="scorebtn"
										v-show="j.isscorename">{{j.scorename}}</button>
									<button @click="canceldeducted(i,index)" class="scorebtn"
										v-show="j.isdscorename">{{j.cscorename}}</button>
									<button @click="remarkable(i,index)" class="remark">备注</button>
									<zwy-popup :ishide="uppo" width="750rpx" height="860rpx" :opacity="opacity"
										:cancelable="cancelable">
										<view class="tjid">
											<scroll-view scroll-y="true" class="uppoo">
												<view>
													<view class="" v-for="(s,index) in i.remarkall"
														:key="i.remarkall.id">
														<view class="uppoborder" @click="addremark(i,index,item)">
															{{s.remark}}</view>
													</view>
												</view>
											</scroll-view>
											<view class="delete" @click="isdele(i,index)">
												+
											</view>
										</view>
									</zwy-popup>
									<view class=""></view>
								</view>
							</view>
							<br>
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
		<view class="bottom-btn">
			<button @click="submit" class="bmbtn">完成</button>
		</view>
		<view v-show="showw">
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<canvas :style="{width:canvasWidth,height:canvasHeight}" canvas-id="myCanvas" @click="checkimg"></canvas>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				cancelable: false,
				opacity: 0.2,
				uppo: false,
				det: 4,
				dst: 6,
				firstfirst: true,
				isstart: true,
				alist: [],
				soyn: 0,
				point: '',
				iaid: '',
				count: 0,
				putremark: '',
				latitude: '',
				longitude: '',
				Evaluator: '',
				thisremark: true,
				isremark: true,
				ifaid: '',
				Image: '',
				igid: '',
				n: 0,
				address: '',
				sum2: [0, 0, 0, 0, 0, 0, 0, 0, 0],
				ggid: '',
				showw: true,
				photoData: [],
				photoArray: [],
				canvasWidth: '',
				canvasHeight: '',
				canvasnone: '',
				photoIndex: 0,
				photoData: '',
				Imageforall: [{
					id: '0',
					tid: 3,
					top:true,
					down:false,
					firstfirst: true,
					first: true,
					remark: '',
					n: 0.6,
					point: '第4条',
					count: 0,
					sid: '1',
					remarkall: [{
							id: 0,
							remark: '4.各类桥梁（隧道）的桥面（隧道）有乱摆摊、兜售商品'
						},
						{
							id: 1,
							remark: '4.乱扔垃圾、乱贴乱画、乱停乱放、污水横流'
						},
						{
							id: 2,
							remark: '4.桥梁（隧道）及相关配套设施设备损坏未及时维修'
						},
						{
							id: 3,
							remark: '4.违章停车、违章设置户外广告设施等现象'
						}
					],
					isimage: true,
					Imageall: [{
							id: '0',
							remark: '',
							isrecover: true,
							hk: null,
							Image: '../../../static/th.jpg',
							fname: '拍照',
							sname: '重拍',
							ban: true,
							scorename: '扣分',
							cscorename: '取消',
							isscorename: true,
							isdscorename: false,
						},
						{
							id: '1',
							remark: '',
							isrecover: true,
							hk: null,
							Image: '../../../static/th.jpg',
							fname: '拍照',
							sname: '重拍',
							ban: true,
							scorename: '扣分',
							cscorename: '取消',
							isscorename: true,
							isdscorename: false,
						},
						{
							id: '2',
							remark: '',
							isrecover: true,
							hk: null,
							Image: '../../../static/th.jpg',
							fname: '拍照',
							sname: '重拍',
							ban: true,
							scorename: '扣分',
							cscorename: '取消',
							isscorename: true,
							isdscorename: false,
						},
						{
							id: '3',
							remark: '',
							isrecover: true,
							hk: null,
							Image: '../../../static/th.jpg',
							fname: '拍照',
							sname: '重拍',
							ban: true,
							scorename: '扣分',
							cscorename: '取消',
							isscorename: true,
							isdscorename: false,
						},
						{
							id: '4',
							remark: '',
							isrecover: true,
							hk: null,
							Image: '../../../static/th.jpg',
							fname: '拍照',
							sname: '重拍',
							ban: true,
							scorename: '扣分',
							cscorename: '取消',
							isscorename: true,
							isdscorename: false,
						},
						{
							id: '5',
							remark: '',
							isrecover: true,
							hk: null,
							Image: '../../../static/th.jpg',
							fname: '拍照',
							sname: '重拍',
							ban: true,
							scorename: '扣分',
							cscorename: '取消',
							isscorename: true,
							isdscorename: false,
						},
						{
							id: '6',
							remark: '',
							isrecover: true,
							hk: null,
							Image: '../../../static/th.jpg',
							fname: '拍照',
							sname: '重拍',
							ban: true,
							scorename: '扣分',
							cscorename: '取消',
							isscorename: true,
							isdscorename: false,
						}
					],
					name: '4.各类桥梁（隧道）的桥面（隧道）有乱摆摊、兜售商品的；有乱扔垃圾、乱贴乱画、乱停乱放、污水横流的；桥梁（隧道）及相关配套设施设备损坏未及时维修的；有违章停车、违章设置户外广告设施等现象的。',
					Image: '../../../static/th.jpg',
					fname: '点击进行拍照',
					sname: '点击重新拍照',
					scorename: '点击扣分',
					ban: true,
					score1: 0,
					score2: 0,
					score3: 0,
					deductedscore: '已扣分',
					isdesco: false
				}]
			}
		},
		onLoad() {

			console.log('你是谁')
			uni.getStorage({
				key: 'img3',
				success: res => {
					console.log('保存的')
					console.log(res)
					this.Imageforall = res.data
				}
			})
			uni.getStorage({
				key: 'det3',
				success: res => {
					console.log('保存的')
					console.log(res)
					this.det = res.data.det
					this.alist = res.data.alist
					this.soyn = res.data.soyn
					this.dst = res.data.dst
				}
			})

			console.log(this.$store.state.townclear)
			console.log(this.det)
		},
		methods: {
			isdele() {
				this.uppo = false
			},
			addremark(e, b, c) {
				console.log(e)
				console.log(b)
				console.log(c)
				// console.log(d)
				this.alist[this.ifaid].Imageall[this.Imageforall[this.ifaid].Imageall[this.iaid].hk].remark = this
					.Imageforall[e.id].remarkall[b].remark
				this.uppo = false
				console.log(this.Imageforall)
				console.log(this.alist)
				uni.setStorage({
					key: 'img3',
					data: this.Imageforall,
					success: (res) => {
						console.log('成功了')
						console.log(res)
						console.log(this.Imageforall)
					}
				})
				// this.Imageforall[e.id].remarkall[b].remark = 
			},
			remarkable() {
				this.uppo = true

				console.log(this.uppo)
			},
			getTime() {
				var date = new Date(),
					year = date.getFullYear(),
					month = date.getMonth() + 1,
					day = date.getDate(),
					hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(),
					minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(),
					second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
				month >= 1 && month <= 9 ? (month = "0" + month) : "";
				day >= 0 && day <= 9 ? (day = "0" + day) : "";
				var timer = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
				return timer;
			},
			canceldeducted(e, b) {
				uni.showModal({
					title: '提示',
					content: '是否对该条取消扣分',
					success: res => {
						var that = this
						if (res.confirm) {
							console.log('用户点击确定');
							console.log('vuex啊啊啊啊', that.$store.state.value)
							that.Imageforall[e.id].Imageall[b].isdscorename = false
							that.Imageforall[e.id].Imageall[b].isscorename = true
							that.Imageforall[e.id].Imageall[b].ban = true
							that.Imageforall[e.id].Imageall[b].Image = '../../../static/th.jpg'
							if (that.$store.state.value == 'A' || that.$store.state.value == 'B') {
								that.Imageforall[e.id].score1 = that.Imageforall[e.id].score1 + 0.12
								that.$store.state.alltownscore[e.tid] = that.Imageforall[e.id].score1
								that.Imageforall[e.id].count -= 1
								console.log(that.Imageforall[e.id].score1)
							} else if (that.$store.state.value == 'C' || that.$store.state.value == 'D' || that
								.$store.state.value == 'E') {
								that.Imageforall[e.id].score1 = that.Imageforall[e.id].score1 + 0.1
								that.Imageforall[e.id].score1 = that.Imageforall[e.id].score1.toFixed(1)
								that.Imageforall[e.id].score1 = parseFloat(that.Imageforall[e.id].score1)
								that.$store.state.alltownscore[e.tid] = that.Imageforall[e.id].score1
								that.Imageforall[e.id].count -= 1
								console.log(that.Imageforall[e.id].score1)
							} else {
								console.log('第三类考评')
							}

							if (that.Imageforall[e.id].score1 == 0) {
								that.Imageforall[e.id].isdesco = false
								that.Imageforall[e.id].isscore1 = false
								that.$store.state.count -= 1
							}
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				})
				console.log(e.id)
				console.log(b)
				console.log(this.Imageforall)
			},
			deducted(e, b) {
					var that = this
					if(that.$store.state.value == 'C' || that.$store.state.value == 'D' || that.$store.state.value == 'E'){
						if (that.Imageforall[e.id].count > 5) {
							uni.showModal({
								title: '提示',
								content: '该指标已达到扣分上限',
								success: res => {
									if (res.confirm) {
										console.log('用户点击确定');
									} else if (res.cancel) {
										console.log('用户点击取消');
									}
								}
							})
						} else {
							that.Imageforall[e.id].Imageall[b].isdscorename = true
							that.Imageforall[e.id].Imageall[b].isscorename = false
							console.log(e)
							console.log(b)
							that.ifaid = e.id
							that.iaid = b
							that.Imageforall[e.id].isdesco = true
							that.Imageforall[e.id].isscore1 = true
							that.Imageforall[e.id].Imageall[b].ban = false
							if (that.$store.state.value == 'A' || that.$store.state.value == 'B') {
								that.Imageforall[e.id].score1 = that.Imageforall[e.id].score1 - 0.12
								that.$store.state.alltownscore[e.tid] = that.Imageforall[e.id].score1
								console.log(that.Imageforall[e.id].score1)
							} else if (that.$store.state.value == 'C' || that.$store.state.value == 'D' || that.$store.state.value == 'E') {
								that.Imageforall[e.id].score1 = that.Imageforall[e.id].score1 - 0.1
								that.Imageforall[e.id].score1 = that.Imageforall[e.id].score1.toFixed(1)
								that.Imageforall[e.id].score1 = parseFloat(that.Imageforall[e.id].score1)
								that.$store.state.alltownscore[e.tid] = that.Imageforall[e.id].score1
								console.log(that.Imageforall[e.id].score1)
							} else {
								console.log('第三类考评')
							}
							// this.Imageforall[e.id].score1 = this.Imageforall[e.id].score1 - 0.12
							that.sum2[e.id] = that.Imageforall[e.id].score1
							that.Imageforall[e.id].count += 1
							console.log('我用咖啡拉花拉出一跳白色的线，举一杯眷恋',that.$store.state.alltownscore)
							console.log(that.Imageforall[e.id].count)
							console.log('-------------------')
							console.log(that.sum2)
							console.log(that.Imageforall)
						}
					}
					if(that.$store.state.value == 'A' || that.$store.state.value == 'B'){
						if (that.Imageforall[e.id].count > 4) {
							uni.showModal({
								title: '提示',
								content: '该指标已达到扣分上限',
								success: res => {
									if (res.confirm) {
										console.log('用户点击确定');
									} else if (res.cancel) {
										console.log('用户点击取消');
									}
								}
							})
						}else {
							that.Imageforall[e.id].Imageall[b].isdscorename = true
							that.Imageforall[e.id].Imageall[b].isscorename = false
							console.log(e)
							console.log(b)
							that.ifaid = e.id
							that.iaid = b
							that.Imageforall[e.id].isdesco = true
							that.Imageforall[e.id].isscore1 = true
							that.Imageforall[e.id].Imageall[b].ban = false
							if (that.$store.state.value == 'A' || that.$store.state.value == 'B') {
								that.Imageforall[e.id].score1 = that.Imageforall[e.id].score1 - 0.12
								that.$store.state.alltownscore[e.tid] = that.Imageforall[e.id].score1
								console.log(that.Imageforall[e.id].score1)
							} else if (that.$store.state.value == 'C' || that.$store.state.value == 'D' || that.$store.state.value == 'E') {
								that.Imageforall[e.id].score1 = that.Imageforall[e.id].score1 - 0.1
								that.Imageforall[e.id].score1 = that.Imageforall[e.id].score1.toFixed(1)
								that.Imageforall[e.id].score1 = parseFloat(that.Imageforall[e.id].score1)
								that.$store.state.alltownscore[e.tid] = that.Imageforall[e.id].score1
								console.log(that.Imageforall[e.id].score1)
							} else {
								console.log('第三类考评')
							}
							// this.Imageforall[e.id].score1 = this.Imageforall[e.id].score1 - 0.12
							that.sum2[e.id] = that.Imageforall[e.id].score1
							that.Imageforall[e.id].count += 1
							console.log('我用咖啡拉花拉出一跳白色的线，举一杯眷恋',that.$store.state.alltownscore)
							console.log(that.Imageforall[e.id].count)
							console.log('-------------------')
							console.log(that.sum2)
							console.log(that.Imageforall)
						}
					}
				},
			addpicture(e, b) {
				uni.chooseImage({
					count: 1,
					sourceType: ['camera'],
					success: (res) => {
						uni.showLoading({
							title: '正在加载...',
							mask: true
						})
						console.log(res)
						console.log(e)
						console.log(e.Imageall[e.id].id)
						this.ggid = e.id
						this.ifaid = e.id
						this.iaid = b
						this.showw = true
						this.point = e.point
						this.dst +=
							1
						var cd =
							this
							.dst
						var ig = {
							id: cd,
							remark: '',
							isrecover: true,
							hk: null,
							Image: '../../../static/th.jpg',
							fname: '拍照',
							sname: '重拍',
							ban: false,
						}
						this.Imageforall[
								this
								.ifaid
								]
							.Imageall
							.push(
								ig
								)
						this.Imageforall[this.ifaid].Imageall[this.iaid].Image = res.tempFilePaths[0]
						console.log(res.tempFilePaths[0])
						uni.getLocation({
							type: 'wgs84',
							geocode: true,
							success: (res) => {
								uni.hideLoading()
								console.log(res)
								this.latitude = res.latitude
								this.longitude = res.longitude
								console.log(this.latitude)
								console.log(this.longitude)
								this.beforeAddWaterMart();
							},
							fail: function() {
								uni.showToast({
									title: '获取地址失败,请检查网络连接',
									icon: 'none'
								});
							}
						})
						// this.beforeAddWaterMart();
					}
				})
			},
			beforeAddWaterMart() {
				console.log('用了')
				this.addWaterMark(() => {
					if (this.photoIndex < this.photoArray.length - 1) {
						this.photoIndex++;
						this.beforeAddWaterMart()
					} else {
						uni.hideLoading()
					}
				})
			},
			addWaterMark(callback) {
				uni.showLoading({
					title: '正在加载水印...',
					mask: true
				})
				console.log('用了')
				uni.getImageInfo({
					src: this.Imageforall[this.ifaid].Imageall[this.iaid].Image,
					success: res => {
						console.log(res)
						this.time = this.getTime();
						if (this.canvasHeight != res.height || this.canvasWidth != res.width) {
							this.canvasWidth = res.width + 'px'
							this.canvasHeight = res.height + 'px'
						} else {
							this.canvasWidth = res.width + 'px'
							this.canvasHeight = res.height + 'px'
						}
						var ctx = uni.createCanvasContext('myCanvas');
						setTimeout(() => {
							ctx.drawImage(this.Imageforall[this.ifaid].Imageall[this.iaid].Image, 0, 0,
								res.width, res.height);
							// ctx.translate(res.width / 2, res.height / 2);
							ctx.beginPath();
							ctx.setFontSize(40);
							ctx.setFillStyle("white")
							ctx.fillText('地点:' + this.$store.state.address, 0, 100)
							ctx.fillText(this.time, 0, 200);
							ctx.fillText('纬度:' + this.latitude + '  ' + '经度:' + this.longitude, 0, 300)
							ctx.draw(false, () => {
								console.log('用了')
								console.log("asdf")
								uni.canvasToTempFilePath({
									canvasId: "myCanvas",
									success: res => {
										console.log(res.tempFilePath)
										// this.Imageforall[this.ifaid].Imageall[this
										// 	.iaid].Image = res.tempFilePath;
										this.showw = false
										this.tempFilePath = res.tempFilePath
										// var formData = new FormData();
										//     formData.append('file', this.tempFilePath);
										console.log(this.Imageforall)
										uni.compressImage({
											src: res.tempFilePath,
											quality: 0,
											success: (res) => {
												uni.compressImage({
													src: res
														.tempFilePath,
													quality: 0,
													success: (
														res
														) => {
														console
															.log(
																res
																)
																
														uni.saveImageToPhotosAlbum({
															filePath: res
																.tempFilePath,
															success: (
																res
																) => {
																this.Imageforall[
																		this
																		.ifaid
																		]
																	.Imageall[
																		this
																		.iaid
																		]
																	.Image =
																	res
																	.path;
																console
																	.log(
																		res
																		)
																if (this
																	.Imageforall[
																		this
																		.ifaid
																		]
																	.first
																	) {
																	this.Imageforall[
																			this
																			.ifaid
																			]
																		.Imageall[
																			this
																			.iaid
																			]
																		.hk =
																		this
																		.soyn
																	this.soyn +=
																		1
																	this.Imageforall[
																			this
																			.ifaid
																			]
																		.first =
																		false
																	var sa = {
																		point: this
																			.point,
																		name: this
																			.Imageforall[
																				this
																				.ifaid
																				]
																			.name,
																		Imageall:[
																			{
																				remark:'无',
																			Image: this
																				.Imageforall[
																					this
																					.ifaid
																					]
																				.Imageall[
																					this
																					.iaid
																					]
																				.Image,
																		}]
																	}
																	this.alist
																		.push(
																			sa
																			)
																	var set =
																		new Set(
																			this
																			.alist
																			)
																	var thisset = [
																		...
																		set
																	]
																	this.alist =
																		thisset
																	console
																		.log(
																			'巴士克特波',
																			this
																			.alist
																			)
																	if (this
																		.firstfirst
																		) {
																		this.Imageforall[
																				this
																				.ifaid
																				]
																			.firstfirst =
																			false
																		// this.$store.state.decifm.push(...this.alist)
																	} else {
																		// this.$store.state.decifm.push(...sa)
																	}
																	console
																		.log(
																			this
																			.$store
																			.state
																			.decifm
																			)
																} else {
																	if (this
																		.Imageforall[
																			this
																			.ifaid
																			]
																		.Imageall[
																			this
																			.iaid
																			]
																		.hk ==
																		null
																		) {
																		this.Imageforall[
																				this
																				.ifaid
																				]
																			.Imageall[
																				this
																				.iaid
																				]
																			.hk =
																			this
																			.soyn
																		this.soyn +=
																			1
																		var ta = {
																			remark: '无',
																			Image: this
																				.Imageforall[
																					this
																					.ifaid
																					]
																				.Imageall[
																					this
																					.iaid
																					]
																				.Image
																		}
																		this.alist[
																				this
																				.ifaid
																				]
																			.Imageall
																			.push(
																				ta
																				)
																		console
																			.log(
																				ta
																				)
																		// this.$store.state.decifm[this.ifaid].Imageall.push(ta)
																		console
																			.log(
																				this
																				.$store
																				.state
																				.decifm
																				)
																		var set =
																			new Set(
																				this
																				.alist
																				)
																		var thisset = [
																			...
																			set
																		]
																		this.alist =
																			thisset
																		console
																			.log(
																				'巴士克特波',
																				this
																				.alist
																				)
																	} else {
																		var recover =
																			this
																			.Imageforall[
																				this
																				.ifaid
																				]
																			.Imageall[
																				this
																				.iaid
																				]
																			.Image
																		this.alist[
																				this
																				.ifaid
																				]
																			.Imageall[
																				this
																				.Imageforall[
																					this
																					.ifaid
																					]
																				.Imageall[
																					this
																					.iaid
																					]
																				.hk
																				]
																			.Image =
																			recover
																		console
																			.log(
																				recover
																				)
																		// this.$store.state.decifm[this.ifaid].Imageall.push(ta)
																		console
																			.log(
																				this
																				.$store
																				.state
																				.decifm
																				)
																		var set =
																			new Set(
																				this
																				.alist
																				)
																		var thisset = [
																			...
																			set
																		]
																		this.alist =
																			thisset
																		console
																			.log(
																				'巴士克特波',
																				this
																				.alist
																				)
																		console
																			.log(
																				this
																				.Imageforall[
																					this
																					.ifaid
																					]
																				.Imageall[
																					this
																					.iaid
																					]
																				.hk
																				)
																	}
																}
																console
																	.log(
																		this
																		.Imageforall[
																			this
																			.ifaid
																			]
																		.first
																		)
																console
																	.log(
																		'它来了它来了',
																		this
																		.alist
																		)
																
																console
																	.log(
																		this
																		.Imageforall
																		)
																// console.log(this.$store.state.decifm)
																
																uni.setStorage({
																	key: 'img3',
																	data: this
																		.Imageforall,
																	success: (
																		res
																		) => {
																		console
																			.log(
																				'成功了'
																				)
																		console
																			.log(
																				res
																				)
																		console
																			.log(
																				this
																				.Imageforall
																				)
																	}
																})
																uni.setStorage({
																	key: 'det3',
																	data: {
																		det: this
																			.det,
																		alist: this
																			.alist,
																		soyn: this
																			.soyn,
																		dst: this
																			.dst
																	},
																	success: (
																		res
																		) => {
																		console
																			.log(
																				'成功了'
																				)
																		console
																			.log(
																				res
																				)
																		console
																			.log(
																				this
																				.dst
																				)
																	}
																})
																uni.setStorage({
																	key: 'town',
																	data: this
																		.$store
																		.state
																		.alltownscore,
																	success: (
																		res
																		) => {
																		console
																			.log(
																				res
																				)
																		console
																			.log(
																				this
																				.$store
																				.state
																				.alltownscore
																				)
																	}
																})
																uni.showToast({
																	title: "保存成功",
																	icon: "none"
																});
															},
															fail: err => {
																console
																	.log(
																		err
																		)
																uni.showToast({
																	title: "保存失败，请稍后重试",
																	icon: "none"
																});
															}
														});

													}
												})
											}
										})

										uni.showToast({
											title: '加载成功',
											icon: 'success',
											duration: 2000,
											mask: true
										})
										callback();
										console.log('用完了')
									}
								})
							});
						}, 100)
					},
					fail: function() {
						uni.showToast({
							title: '获取图片失败',
							icon: 'none'
						});
					}
				})
			},
			checkimg(e, b) {
				console.log(e)
				console.log(b)
				uni.previewImage({
					urls: [this.Imageforall[e.id].Imageall[b].Image],
					success: (res) => {
						console.log(this.Imageforall[e.id].Imageall[b].Image)
					},
					fail: function() {
						uni.showToast({
							title: '网络错误,请检查网络连接',
							icon: 'none'
						});
					}
				})
			},
			submit() {
				this.$store.state.decifm.push(...this.alist)
				const combinedData = this.$store.state.decifm.reduce((acc, cur) => {
					const found = acc.find(obj => obj.name === cur.name);
					if (found) {
						found.Imageall.push(...cur.Imageall);
					} else {
						acc.push(cur);
					}
					return acc;
				}, []);
				console.log(combinedData);
				const uniqueArr = combinedData.filter((item, index) => {
					return combinedData.findIndex(obj => {
						return JSON.stringify(obj) === JSON.stringify(item);
					}) === index;
				});
				this.$store.state.decifm = uniqueArr
				console.log(uniqueArr);
				var thedec = new Set(this.$store.state.decifm)
				console.log(thedec)
				var truedec = [...thedec]
				this.$store.state.decifm = truedec
				console.log(truedec)
				this.$store.state.decifm.forEach((item) => {
					const lb = new Set(item.Imageall.map((image) => image.Image));
					item.Imageall = Array.from(lb).map((image) => {
						return item.Imageall.find((img) => img.Image === image);
					});
				});
				console.log(this.Imageforall)
				uni.showToast({
					title: '保存成功'
				})
				uni.setStorage({
					key: 'alldecifm',
					data: this.$store.state.decifm,
					success: (res) => {
						console.log(res)
					}
				})
				// uni.request({
				// 	url: 'http://192.168.0.37:8000/kaoping/excelfile/',
				// 	method: 'POST',
				// 	data: {
				// 		name: 'sad',
				// 		score_list: this.sum2,
				// 		category: '123',
				// 		position: '2222'
				// 	},
				// 	success: res => {
				// 		console.log('传好了')
				// 		console.log(res)
				// 	}
				// })
			}
		}
	}
</script>

<style>
	.uppoborder {
		width: 750rpx;
		border: 1px solid skyblue;
		background-color: #F8F8FF;
		text-align: center;
		margin-top: 10rpx;
	}

	.uppoborder:active {
		background-color: deepskyblue;
	}

	.tjid {
		width: 750rpx;
		height: 860rpx;
		background-color: #363636;


		/* transform: rotate(45deg); */
		/* opacity: 0; */
	}

	.delete {
		position: fixed;
		bottom: 0;
		/* right: 200rpx; */
		width: 70rpx;
		height: 70rpx;
		border-radius: 50%;
		margin-left: 365rpx;
		margin-top: 960rpx;
		transform: rotate(45deg);
		color: white;
		font-size: 80rpx;
		text-align: center;
		/* background-color: pink; */

	}

	.remark {
		font-size: 20rpx;
		width: 100rpx;
		height: 50rpx;
		background-color: pink;
		margin-left: 20rpx;
		margin-top: 10rpx;
	}

	.uppoo {
		/* float: left; */
		background-color: white;
		width: 750rpx;
		height: 750rpx;
		/* opacity: 0.1; */
		z-index: 1;
	}

	.scroll {
		height: 100%;
	}

	.picbtn {
		/* float: left; */
		font-size: 20rpx;
		width: 100rpx;
		height: 50rpx;
		background-color: pink;
		margin-left: 20rpx;
		margin-top: 10rpx;
	}

	.bottom-btn {
		position: fixed;
		margin-top: 20rpx;
		width: 100%;
		bottom: 0rpx;
	}

	.bmbtn {
		background-color: skyblue;
		color: whitesmoke;
	}

	.bmbtn:active {
		background-color: deepskyblue;
	}



	.scorebtn {
		font-size: 20rpx;
		/* margin-top: -50rpx; */
		width: 100rpx;
		height: 50rpx;
		margin-top: 15rpx;
		margin-left: 20rpx;
		/* margin-left: 450rpx; */
		/* background-color: pink; */
	}

	.btn {
		float: left;
		/* margin-top: 150rpx; */
	}

	.border {
		clear: both;
		width: 750rpx;
		border: 1px solid skyblue;
		background-color: #F8F8FF;
	}

	.desco {
		float: right;
		width: 115rpx;
		height: 115rpx;
		line-height: 110rpx;
		text-align: center;
		/* margin-left: 600rpx; */
		margin-right: 25rpx;
		margin-top: 15rpx;
		border-radius: 50%;
		border: 1px solid red;
		/* background-color: red; */
		color: red;
	}

	.scoref {
		float: right;
		/* margin-left: 300rpx; */
		margin-right: 20rpx;
		margin-top: -50rpx;
		color: red;
	}
</style>